xen: arm: remove hardcoded gnttab location from dom0
authorIan Campbell <ian.campbell@citrix.com>
Wed, 4 Dec 2013 17:03:02 +0000 (17:03 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 6 Dec 2013 11:45:21 +0000 (11:45 +0000)
commitb490724477f9215bb7a0a3e3b1ebe01e0fc20c17
treebb2a400ca9b1d9fadf1af8b2cba240e04edbb31f
parent1ed76797439e384de18fcd6810bd4743d4f38b1e
xen: arm: remove hardcoded gnttab location from dom0

The DT provided to guests (including dom0) includes a Xen node which, among
other things, describes an MMIO region which can be safely used for grant
table mappings (i.e. it is a hole in the physical address space). For domU we
provide a hardcoded values based on our hardcoded guest virtual machine
layout. However for dom0 we need to fit in with the underlying platform.
Leaving this hardcoded was an oversight which on some platforms could result
in the grant table overlaying RAM or MMIO regions which are in use by domain
0.

For the 4.4 release do as we did with the dom0 evtchn PPI and provide a hook
for the platform code to supply a suitable hardcoded address for the platform
(derived from reading the data sheet). Platforms which do not provide the hook
get the existing address as a default.

After 4.4 we should switch to selecting a region of host RAM which is not RAM
in the guest address map. This should be more flexible and safer but the patch
was looking too complex for 4.4.

Platform        Gnttab Address
========        ==============
exynos5.c       0xb0000000, confirmed and tested by Julien.
sunxi.c         0x01d00000, confirmed in data sheet.
midway.c        0xff800000, confirmed by Andre, boot tested by Ian.
vexpress.c      0xb0000000, existing hardcoded value was selected for vexpress.
omap5.c         0x4b000000, confirmed by Baozi
xgene-storm.c   0x1f800000, confirmed by Pranavkumar

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Julien.Grall@linaro.org
Cc: Stefano.Stabellini@eu.citrix.com
Cc: Andre Przywara <andre.przywara@linaro.org>
Acked-by: Chen Baozi <baozich@gmail.com>
Acked-by: Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
Cc: Anup Patel <apatel@apm.com>
xen/arch/arm/domain_build.c
xen/arch/arm/platform.c
xen/arch/arm/platforms/midway.c
xen/arch/arm/platforms/omap5.c
xen/arch/arm/platforms/sunxi.c
xen/arch/arm/platforms/xgene-storm.c
xen/include/asm-arm/platform.h